package com.sdutcm.health_bigdata_demo.controller;

import com.sdutcm.health_bigdata_demo.bean.Supply;
import com.sdutcm.health_bigdata_demo.service.SupplyAndDemandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @author 小浩
 * @date 2018-09-23 16:34
 * @package com.sdutcm.health_bigdata_demo.controller
 * @description
 */
@RestController
@RequestMapping("/supply")
public class SupplyContrller {
    @Autowired
    SupplyAndDemandService supplyAndDemandService;

    //发布供应
    @RequestMapping("/save")
    public boolean saveSupply(Supply supply){
        return supplyAndDemandService.saveSupply(supply);
    }
    //获取全部供应
    @RequestMapping("/get_All")
    public List getAllSupply(){
        return supplyAndDemandService.getAllSupply();
    }
    //关键字查询供应
    @RequestMapping("/get_all_fuzzy")
    public List getAllSupplyFuzzy(String key){
        return supplyAndDemandService.getAllSupplyFuzzy(key);
    }

}
